#!/bin/bash
#=======================================================================
# run_all.sh
#  Run the Jablonowski&Williamson (2006) dynamical core test for all
#  schemes and tests (steady state and baroclinic wave)
#                                            2012/11/04 Daisuke Hotta
#=======================================================================

MODELS=( ncyc1 ncyc2 ncyc3 ncyc4 ncyc_expl leapfrog leapfrog_expl )
TESTS=( steady barocl )

for M in ${MODELS[@]}; do
  if [[ $M == *ncyc* ]]; then
    for V in _3a _3b _3ab _4a _4b _4abba; do
      for T in ${TESTS[@]}; do
        echo "======= $M$V $TEST =========="
        sed -e 's/modelname=.*$/modelname='${M}'/'     \
            -e 's/ncycversion=.*$/ncycversion='${V}'/' \
            -e 's/testname=.*$/testname='${T}'/' < ./run_dyncore_test.sh| sh
      done
    done
  else
    for T in ${TESTS[@]}; do
      V=''
      echo "======= $M$V $TEST =========="
      sed -e 's/modelname=.*$/modelname='${M}'/'     \
          -e 's/ncycversion=.*$/ncycversion='${V}'/' \
          -e 's/testname=.*$/testname='${T}'/' < ./run_dyncore_test.sh| sh
    done
  fi
done
